home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / Q-R / RR⁄Tabby Source Code.cpt / Export 3.21.source < prev    next >
Text File  |  1990-05-25  |  64KB  |  2,018 lines

  1.  
  2.      ' Code by:      Mike Lininger
  3.      '               385 Bowling Green Place 
  4.      '               Gahanna, Ohio  43230
  5.      '               (614) 471-6209 (BBS)
  6.  
  7. 5-25-90
  8.  
  9. I am making most of my code available to anyone interested in developing 
  10. their own Second Sight/Tabby utilities.  This source is not designed to be 
  11. compiled and run.  It is missing key functions and pieces of code that are 
  12. Copyright me and others, that are not to be released at this time. 
  13.  
  14. This code is for example purposes only.  It illustrates various ways of reading
  15. writing and process data from a variety of SS/Tabby files.  It illustrates
  16. the use of Block Reads and Indexes amoung other things.
  17.  
  18. If you use any portion of this code you must abide by two rules, or you
  19. void the agreement that I am making with you and are subject what the law
  20. dictates.
  21.  
  22. They are simple. 
  23.  
  24. 1.  If you us any of this code you must give Michael Lininger and Lininger 
  25. Technology credit in both the program and the documentation.
  26.  
  27. 2.  It is agreed I am to receive a free copy of the program whether it is 
  28. free, sharware or commercial.
  29.  
  30. Now you must read on a little further and we will be done.
  31.  
  32. A little history on why I choose ZBasic as the root for my utilities.
  33. I use to be one of those people that would smirk every time someone mentioned
  34. they were using BASIC (until 3 years ago I and others had ever right to
  35. smirk) and would say how nice.  But thought yeh!  Real programmers only use
  36. C or Assembler.
  37.  
  38. Then came along Microsofts QuickBasic for the IBM.  This baby was hot 
  39. it gave you all features of C and Pascal, plus core logic of Assembler, 
  40. all packaged into a neat super easy to learn and use package.  This cut out
  41. months of development work plus the finial applications were a hell of a lot 
  42. better looking, cause you could do so much in a short period of time.  
  43. This set the tide for a new generation of Basic's.  Zedcor introduced ZBasic 
  44. for the mac, which gave complete control over the toolbox plus it compiled 
  45. into nice neat assembly and was fast. 
  46.  
  47. ZBasic I have found to be extremely powerful and fast, in most cases it 
  48. matches or out performs the best C compilers out there. Now when someone 
  49. says heh I finished this great C project that I have been working on for 6 
  50. months, I now smirk and say how nice.  But think yeh!  I could have done 
  51. the same thing in 1/4 the time and saved you 300,000.00 and ended up with 
  52. a lot cleaner and more professional looking product all at the cost of an 
  53. extra 14k of file size.
  54.  
  55. The only draw back to ZBasic is it lack of Data structures, but this is
  56. made up for the use of Indexes.  C programmer salivate all over the place
  57. at the mention of theses babies.  They give you performance you never dreamed
  58. of.  Now of we could just get Zedcor to give us a dozen more, WOW.
  59.  
  60. Moral of the story - DO NOT EVER underestimate the POWER of Compiled Basic.
  61.  
  62. Have at it.  I hope a lot of people will use this as a jumping off point
  63. and dive into creating a flood of new SS/Tabby utilities.
  64.  
  65. I can be reached on the networks if you have questions.
  66.  
  67.         614-471-6209 9600 baud
  68.         614-471-5733 2400 baud
  69.  
  70.         M.Lininger  Genie
  71.         Mike Lininger FidoNet (Tabby, RRH, MANSION echoes)
  72.         Mike Lininger 1:226/200
  73.         Mike Lininger via cmhGate - Net 226 fido<=>uucp gateway Col, OH
  74.         UUCP: ...!ous-cis!n8emr!cmhgate!200.2!Mike.Lininger
  75.         INET: Mike.Lininger@p2.f200.n226.z1.FIDONET.ORG
  76.  
  77.  
  78.  
  79.  
  80.  
  81.      ' Code is in ZBasic 5.0
  82.  
  83.      ' Michael Lininger (Lininger Technology)
  84.      ' Code is provided AS IS
  85.      ' Start date: 3-25-89
  86.      ' Last modify date: 1-26-90
  87.      ' Version: 3.21 Release
  88.      ' Export Module for Tabby 2.1x
  89.      ' MKLx - Creator
  90.      ' TExp - Type
  91.  
  92.      ' To Prevent your application from say "You will not be able to print"
  93.      ' if it does not find a Print Driver in your system do the following
  94.      ' on the finial campiled application.  DO NOT DO IT ON ZBASIC ITSELF.
  95.      ' Use FEDIT do a Hex search for 50EDFD3C and change 50ED to FD3C.
  96.  
  97.      ' Sets up application.  Turns off Startup Window, Sets Default Mouse
  98.      WINDOW OFF
  99.      COORDINATE WINDOW
  100.      DEF MOUSE=-1
  101.      WIDTH -2
  102.      FLUSHEVENTS
  103.      ON ERROR GOSUB 65535
  104.  
  105.      ' Define Arrays that will be needed throughout the application
  106.      DIM 50 Tabby$(100) 
  107.      DIM 25 MsgName$(255)
  108.      DIM 80 Sign$(10), b$(5)
  109.      DIM 1 MsgType$(255),1 MessageSection$(255)
  110.      DIM SectionCount%(255), ExportCount%(255)
  111.      DIM t%,l%,b%,r%
  112.      DIM HelpT%,HelpL%,HelpB%,HelpR%
  113.      DIM b%(11)
  114.      DIM 32 AKAName$(100)
  115.      DIM 11 AKANode$(100)
  116.  
  117.      '   Record structure and equates for
  118.      '   Catalog Information Parameter Block Record (CInfoPBRec$)
  119.      '   -       ----        -         -     ---
  120.      DIM CInfoPBRec$
  121.           CInfoPBRecPtr&=VARPTR(CInfoPBRec$)
  122.  
  123.      DIM DirectoryName$, FullPathName$
  124.           IONamePtr&=VARPTR(DirectoryName$)
  125.           FSRtDir&=2&
  126.  
  127.      '   Record structure and equates for
  128.      '   Working Directory Parameter Block Record (WDPBRec$)
  129.      '   -       -         -         -     ---
  130.      DIM WDPBRec$
  131.           WDPBRecPtr&=VARPTR(WDPBRec$)
  132.  
  133.      True=NOT False
  134.  
  135.      ' Functions that are used by the application
  136.      ' ------------------------------------------
  137.  
  138.      LONG FN ScrollingHelp(RectPtr&,ResID%,HelpBtn%)
  139.  
  140.           'This function has been removed.
  141.           'This function is copyright  Ariel Publishing
  142.           'This function is from the Function Junction Package offered
  143.           'by Ariel Publishing.  For more info call 509-923-2249
  144.  
  145.      END FN
  146.  
  147.      LONG FN FormatWnd(WndToFormat%)
  148.  
  149.           'This function has been removed.
  150.           'This function is copyright  Ariel Publishing
  151.           'This function is from the Function Junction Package offered
  152.           'by Ariel Publishing.  For more info call 509-923-2249
  153.  
  154.           LONG IF WndToFormat% <> 3
  155.                GOSUB "Format_Window"
  156.           END IF
  157.  
  158.      END FN
  159.  
  160.      LONG FN PathNameFromDirID$(DirID&,WDRefNum%)
  161.           FullPathName$="" 
  162.  
  163.            This function determines the pathname for a file dd80:bbs:Mike
  164.           'This function has been removed.
  165.           'This function is copyright  Ariel Publishing
  166.           'This function is from the Function Junction Package offered
  167.           'by Ariel Publishing.  For more info call 509-923-2249
  168.  
  169.      END FN=FullPathName$
  170.  
  171.      LONG FN ConvertWDRef$(FileName$,WDRefNum%)
  172.  
  173.            This function determines the pathname for a file dd80:bbs:Mike
  174.           'This function has been removed.
  175.           'This function is copyright  Ariel Publishing
  176.           'This function is from the Function Junction Package offered
  177.           'by Ariel Publishing.  For more info call 509-923-2249
  178.  
  179.      END FN=FN PathNameFromDirID$(IOWDDirID&,IOWDVRefNum%)+FileName$
  180.  
  181.      ' This function turns a Pascal-encoded string into ZBasic-usable form
  182.      DEF FN MakeString$(String$) = MID$(String$, 2, ASC(LEFT$(String$,1)))
  183.  
  184.   
  185.      ' convert string resource to a string, handle must be passed to this function
  186.      LONG FN ReturnString$(SHndl&)
  187.              FByte%=PEEK(PEEK LONG(SHndl&))
  188.              String$=""      
  189.             FOR I%=1 TO FByte%
  190.                 String$=String$+CHR$(PEEK(PEEK LONG(SHndl&)+I%))
  191.              NEXT I%
  192.      END FN = String$
  193.  
  194.      ' ------------------------------------------
  195.  
  196. "Export_Start"
  197.  
  198.      APPLE MENU "Export 3.21"
  199.      MENU 1,0,1,"File"
  200.      MENU 1,1,1, "Michael Lininger"
  201.      MENU 1,2,1, "Lininger Technology"
  202.      MENU 1,3,1, "385 Bowling Green Place"
  203.      MENU 1,4,1, "Gahanna, Ohio  43230"
  204.      EDIT MENU 2
  205.      MENU 3,0,0,"Aurora Borealis  614-471-6209"
  206.  
  207.      ' Loads starting values and pathnames from Str Resource file
  208.  
  209.      Cur%=128:LErr%=0
  210.      GOSUB "Get_Resource_Values"
  211.      GOSUB "Cursor_Spin"
  212.  
  213.  
  214.      ' Checks to see if mouse key is down, if so then goto configure menu
  215.   
  216.      MOUSE ON
  217.      DEF MOUSE = 0
  218.      Hold%=MOUSE(3)
  219.      LONG IF Hold% <> 0
  220.  
  221.          GOSUB "Cursor_Spin"
  222.          DEF MOUSE = -1
  223.          GOSUB "Configure_Menu"
  224.          IF rscs%=1 THEN rscs%=0:CALL CLOSERESFILE(Refnum%)
  225.          CURSOR 0
  226.          END
  227.  
  228.      END IF
  229.      MOUSE OFF
  230.      DEF MOUSE = -1
  231.  
  232.      GOSUB "Build_Main_Window"
  233.      GOSUB "Cursor_Spin"
  234.      IF LEN(BBSFolder$) <=1 THEN BBSFolder$=""
  235.      IF RRHost$="" THEN RRHost$="Red Ryder Host"
  236.      GenericFile$=BBSFolder$+"Generic"
  237.      ConfigFile$=BBSFolder$+"Config"
  238.      RRHost$=BBSFolder$+RRHost$
  239.      TabbyNet$=BBSFolder$+"TabbyNet"
  240.      NextLaunch$=BBSFolder$+"Launch.Next"
  241.      TabbyConfig$=BBSFolder$+"Tabby:Tabby Config"
  242.      TabbyAreas$=BBSFolder$+"Tabby:Areas.bbs"
  243.      IF INSTR(1,AKAFile$,":") = 0 THEN AKAFile$=BBSFolder$+AKAFile$
  244.  
  245.      TotalBytes&=0    
  246.      GOSUB "Get_Tabby_Files"
  247.      GExport$=GenericFile$+"Generic Export"
  248.      GImport$=GenericFile$+"Generic Import"
  249.      GEchoes$=GenericFile$+"Generic Echoes"
  250.      GSeenby$=GenericFile$+"Seenby.bbs"
  251.      GOSUB "Cursor_Spin"
  252.  
  253.      GOSUB "Config_Read"
  254.      GOSUB "Messages_Read"
  255.  
  256.      a&=659200
  257.      d&=32000
  258.      overhead&=c&+d&
  259.      n&=a&+overhead&
  260.  
  261.      ERROR = 0
  262.  
  263.      LONG IF b%(1) = 2
  264.           ErrCode%=1
  265.           OPEN "N",1,MsgHdrFilename$
  266.           MsgHdrSize& = LOF(1,1)
  267.           CLOSE #1
  268.           IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  269.  
  270.           m&=MEM(-1)
  271.           LONG IF MsgHdrSize&+overhead& < m&
  272.                a&=MsgHdrSize&
  273.           XELSE
  274.                GOSUB "Memory_Check"
  275.           END IF
  276.      XELSE
  277.           a&=206000
  278.           LONG IF a&+overhead& < m&
  279.                GOSUB "Memory_Check"
  280.           END IF
  281.      END IF
  282.  
  283.      CLEAR a&,0
  284.      CLEAR d&,1
  285.      GOSUB "Cursor_Spin"
  286.      R_MsgCount&=a&
  287.      
  288.  
  289.      StartTime$=DATE$+" "+TIME$+" Export Start"
  290.      STime&=TIMER
  291.      RecStart&=1
  292.      ERROR = 0
  293.      LONG IF b%(1) = 1
  294.           ErrCode%=1
  295.           ReNumber%=1:ReStart%=1
  296.           OPEN "N",1,MsgHdrFilename$,206
  297.           ax&=LOF(1,1)
  298.           RecCount&=ax&/206
  299.           LowBound&=0:HiBound&=RecCount&:FoundIt%=0
  300.           ' Original idea for this binary search was from Pete Johnson
  301.           WHILE ((HiBound&-LowBound&) > 1) AND (FoundIt%=0)
  302.                Rct&=(LowBound&+HiBound&)/2
  303.                RECORD #1,Rct&,2
  304.                READ #1,MessageNumber&
  305.                IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  306.  
  307.                LONG IF MessageNumber& > OldHighMessage&
  308.                     HiBound&=Rct&
  309.                XELSE
  310.                     LONG IF MessageNumber& < OldHighMessage&
  311.                          LowBound&=Rct&
  312.                     XELSE
  313.                          RecStart&=Rct&
  314.                          FoundIt%=1
  315.                     END IF
  316.                END IF
  317.           WEND
  318.           CLOSE #1        
  319.      END IF
  320.  
  321.      ERROR = 0
  322.      ErrCode%=3
  323.      OPEN "N",1,MsgHdrFilename$
  324.      R_MsgLength&=LOF(1,1)
  325.      MsgCnt&=R_MsgLength&/206
  326.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  327.  
  328.      LONG IF R_MsgLength& < R_MsgCount&
  329.           R_MsgCount&=R_MsgLength&
  330.      END IF
  331.       
  332.      MsgSkip&=(RecStart&*206)-206
  333.  
  334.      LONG IF (R_MsgLength&-MsgSkip&) < R_MsgCount&
  335.           R_MsgCount&=R_MsgLength&-MsgSkip&
  336.      END IF
  337.  
  338.      Position&=MsgSkip&
  339.      IF Position& <= 0 THEN Position&=0:Full%=1
  340.      BytesLeft&=R_MsgLength&
  341.      TotalBytes&=Position&
  342.      GOSUB "Cursor_Spin"
  343.  
  344.      ERROR = 0
  345.      ErrCode%=4
  346.      OPEN "N",2,MsgTxtFilename$
  347.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  348.  
  349.      ERROR = 0:ErrCode%=5
  350.      DEF OPEN "TEXTEDIT"
  351.      OPEN "A",5,GExport$
  352.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  353.  
  354.      ERROR = 0:ErrCode%=6
  355.      DEF OPEN "TEXTEDIT"
  356.      OPEN "A",7,GSeenby$
  357.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  358.  
  359.      ERROR = 0:ErrCode%=7
  360.      DEF OPEN "TEXTEDIT"
  361.      OPEN "A",4,GEchoes$
  362.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  363.   
  364.      TotalBytes&=0:Graph%=1:ScanCount%=0
  365.      ERROR = 0
  366.      WHILE NOT EOF(1)
  367.           ErrCode%=8
  368.           RECORD #1,0,Position&
  369.           READ FILE #1,MEM(0+40),R_MsgCount&
  370.           IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  371.  
  372.           RecordCount%=R_MsgCount&/206
  373.           x&=0
  374.           FOR fCnt%=1 TO RecordCount%
  375.                ScanCount&=ScanCount&+1
  376.                Status$=CHR$(PEEK(MEM(0+40)+x&))
  377.                Section%=CVI(CHR$(PEEK(MEM(0+40)+x&+6)))
  378.                MsgNumber&=PEEK LONG(MEM(0+40)+x&+2)
  379.                MessageOffSet&=PEEK LONG(MEM(0+40)+x&+188)
  380.                MessageLength&=PEEK LONG(MEM(0+40)+x&+192)
  381.                ReplyNumber&=PEEK LONG(MEM(0+40)+x&+196)
  382.                MessageType%=VAL(MessageSection$(Section%))
  383.                SectionCount%(Section%)=SectionCount%(Section%)+1
  384.             
  385.                LONG IF ((ASC(Status$) AND 1) <> 1): 'Not Deleted
  386.                     LONG IF MessageType%=3 OR MessageType%=4: 'Valid Section
  387.                          LONG IF ((ASC(Status$) AND 64) <> 64): ' Not Already Echo Processed
  388.                               GOSUB "Export_Message"
  389.                               BitSet%=255
  390.                               Status%=ASC(Status$)
  391.                               Status%=Status%+64
  392.                               LONG IF b%(2)=2
  393.                                    IF Section%=NetMailArea% THEN Status%=Status%+1
  394.                               END IF
  395.                               POKE MEM(0+40)+x&,Status%
  396.                          END IF
  397.                     END IF
  398.                XELSE
  399.                     IF ((ASC(Status$) AND 64) <> 64) AND (MessageType%=3 OR MessageType%=4) THEN DeleteCount&=DeleteCount&+1
  400.                END IF
  401.                x&=x&+206
  402.                TotalBytes&=TotalBytes&+206
  403.                Graph%=Graph%+1
  404.                LONG IF Graph%=45 OR (Graph%=10 AND b%(1)=1)
  405.                     PEN ,,1,9,3
  406.                     Graph%=1
  407.                     x!=TotalBytes&/R_MsgLength&
  408.                     x!=x!*100
  409.                     Brad%=x!*2.55
  410.                     CIRCLE FILL 130,23,14 TO 0,Brad%
  411.                     GOSUB "Cursor_Spin"
  412.                END IF
  413.           NEXT fCnt%
  414.         
  415.           LONG IF BitSet%=255
  416.                ERROR = 0:ErrCode%=9
  417.                RECORD #1,0,Position&
  418.                WRITE FILE #1,MEM(0+40),R_MsgCount&
  419.                IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  420.           END IF
  421.  
  422.           BitSet%=0
  423.           Position&=Position&+R_MsgCount&
  424.           BytesLeft&=BytesLeft&-R_MsgCount&
  425.           LONG IF Position&+R_MsgCount& > R_MsgLength&
  426.                R_MsgCount& = R_MsgLength&-Position&
  427.           END IF
  428.           IF R_MsgCount& <= 0 THEN R_MsgCount&=100000
  429.  
  430.           GOSUB "Cursor_Spin"
  431.  
  432.      WEND
  433.      SFTime$=DATE$+" "+TIME$
  434.      PEN ,,1,9,3
  435.      Brad%=255
  436.      CIRCLE FILL 130,23,14 TO 0,Brad%
  437.      GOSUB "Cursor_Spin"
  438.  
  439.      CLOSE #1:CLOSE #2:CLOSE #5:CLOSE #4:CLOSE #7
  440.      RESET
  441.      FinishTime$=DATE$+" "+TIME$+" Export Finish"
  442.      FTime&=TIMER
  443.  
  444.      LONG IF b%(3)=2
  445.           GOSUB "Notify_Sysop"
  446.      END IF
  447.      LONG IF b%(6)=2
  448.           GOSUB "Log_Report"
  449.      END IF
  450.       
  451.      default$=STR$(HighMessage&)
  452.      default$=RIGHT$(default$,LEN(default$)-1)
  453.      ResourceCount%=1233
  454.      StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  455.      CALL SETSTRING(StrHnd&,default$)
  456.      CALL CHANGEDRESOURCE(StrHnd&)
  457.      CALL UPDATERESFILE(Refnum%)
  458.      GOSUB "Cursor_Spin"
  459.      bCnt%=2
  460.      FOR j% = 1253 TO 1256
  461.           default$=b$(bCnt%)
  462.           StrHnd&=FN GETRESOURCE(CVI("STR "),j%)
  463.           CALL SETSTRING(StrHnd&,default$)
  464.           CALL CHANGEDRESOURCE(StrHnd&)
  465.           CALL UPDATERESFILE(Refnum%)
  466.           bCnt%=bCnt%+1
  467.      NEXT j%
  468.      default$=DATE$+" "+TIME$+STR$(ScanCount&)+" msgs scanned,"+STR$(ExportCount&)+ " exported, in"+STR$(FTime&-STime&)+" seconds"
  469.      ResourceCount%=1257
  470.      StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  471.      CALL SETSTRING(StrHnd&,default$)
  472.      CALL CHANGEDRESOURCE(StrHnd&)
  473.      CALL UPDATERESFILE(Refnum%)
  474.  
  475.      GOSUB "Tabby_Launch"
  476.      RESET
  477.      END
  478.  
  479.  
  480. "Log_Report"
  481.  
  482.      LONG IF b%(7)=1
  483.           ERROR = 0 :ErrCode%=10
  484.           DEF OPEN "TEXTEDIT"
  485.           OPEN "A",6,ReportLog$
  486.           PRINT #6,StartTime$
  487.           PRINT #6,SFTime$;STR$(ExportCount%);" messages exported"
  488.           PRINT #6,FinishTime$
  489.           CLOSE #6
  490.           IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  491.       XELSE
  492.           LONG IF b%(8)=2
  493.                ERROR = 0:ErrCode%=11
  494.                DEF OPEN "TEXTEDIT"
  495.                OPEN "O",6,ReportLog$
  496.                IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  497.           XELSE
  498.                Error=0:ErrCode%=12
  499.                DEF OPEN "TEXTEDIT"
  500.                OPEN "A",6,ReportLog$
  501.                IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  502.           END IF
  503.           ERROR = 0:ErrCode%=13
  504.           PRINT #6, StartTime$
  505.           IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  506.           GOSUB "LogWrite"
  507.           ERROR = 0:ErrCode%=14
  508.           FOR j%= 1 TO 255
  509.                LONG IF ExportCount%(j%) <> 0
  510.                     PRINT #6, USING "########";ExportCount%(j%);
  511.                     IF MsgName$(j%)="" THEN MsgName$(j%)="Inactive Area"
  512.                     PRINT #6, " ";:PRINT #6,MsgName$(j%)
  513.                END IF
  514.           NEXT j%
  515.           PRINT #6,FinishTime$
  516.           PRINT #6,"---------------"
  517.           IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  518.           CLOSE #6
  519.      END IF
  520.      RETURN
  521.  
  522.  
  523. "LogWrite"
  524.  
  525.      ERROR = 0:ErrCode%=15
  526.      PRINT #6, USING "########";ScanCount&;:PRINT #6," Messages Scanned"
  527.      PRINT #6, USING "########";ExportCount&;:PRINT #6," Messages Exported"
  528.      PRINT #6, USING "########";EchoCount&;:PRINT #6," Echo Messages Exported"
  529.      PRINT #6, USING "########";NetCount&;:PRINT #6," NetMail Messages Exported"
  530.      PRINT #6, USING "########";DeleteCount&;:PRINT #6," Deleted Mail NOT Exported"
  531.      PRINT #6, USING "########";Point%;:PRINT #6," Reply Mail to Points"
  532.      PRINT #6, USING "########";EBytes&;:PRINT #6," Total Bytes Exported"
  533.      PRINT #6, USING "########";(FTime&-STime&);:PRINT #6," Elapsed Time (Seconds)"
  534.      PRINT #6, USING "########";LowMessage&;:PRINT #6," Low Message Number"
  535.      PRINT #6, USING "########";HighMessage&;:PRINT #6," High Message Number"
  536.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  537.  
  538.      RETURN
  539.  
  540.  
  541. "Notify_Sysop"
  542.  
  543.      ERROR = 0:ErrCode%=16
  544.      DEF OPEN "TEXTEDIT"
  545.      OPEN "A",6,GImport$
  546.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  547.  
  548.      Catagory$=STR$(NetMailArea%)
  549.      Catagory$=RIGHT$(Catagory$,LEN(Catagory$)-1)
  550.      FOR k%= LEN(Catagory$) TO 2
  551.           Catagory$="0"+Catagory$
  552.      NEXT k%
  553.      a$=LEFT$(DATE$,2)+"/"
  554.      a$=a$+MID$(DATE$,4,2)+"/"
  555.      a$=a$+RIGHT$(DATE$,2)
  556.   
  557.      b$=LEFT$(TIME$,2)+":"
  558.      b$=b$+MID$(TIME$,4,2)+":"
  559.      b$=b$+RIGHT$(TIME$,2)
  560.  
  561.      ERROR = 0:ErrCode%=17
  562.      PRINT #6,".M.";CHR$(13);
  563.      PRINT #6,Catagory$;CHR$(13);
  564.      PRINT #6,a$;CHR$(13);
  565.      PRINT #6,b$;CHR$(13);
  566.      PRINT #6,"";CHR$(13);
  567.      PRINT #6,"Export Engine 3.2";CHR$(13);
  568.      PRINT #6,SysopName$;CHR$(13);
  569.      PRINT #6,"Export 3.2 Report "+TIME$;CHR$(13);
  570.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  571.  
  572.      ERROR = 0:ErrCode%=18
  573.      FOR j% = 1 TO 5
  574.           PRINT #6, b$(j%);CHR$(13);
  575.      NEXT j%
  576.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  577.         
  578.      ERROR = 0:ErrCode%=19
  579.      PRINT #6,"";CHR$(13);
  580.      PRINT #6,StartTime$;CHR$(13);
  581.      PRINT #6,FinishTime$;CHR$(13);
  582.      PRINT #6,"";CHR$(13);
  583.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  584.  
  585.      GOSUB "LogWrite"
  586.      ICnt%=0
  587.      ERROR = 0:ErrCode%=20
  588.      FOR j% = 1 TO 255
  589.           LONG IF ExportCount%(j%) <> 0
  590.                PRINT #6, USING "########";ExportCount%(j%);
  591.                IF MsgName$(j%)="" THEN MsgName$(j%)="Inactive Area"
  592.                ax$=MsgName$(j%)+SPACE$(25)
  593.                PRINT #6, " ";:PRINT #6,LEFT$(ax$,25);
  594.                ICnt%=ICnt%+1
  595.                LONG IF ICnt%=2
  596.                     PRINT #6,CHR$(13);
  597.                     ICnt%=0
  598.                XELSE
  599.                     PRINT #6,"  ";
  600.                END IF
  601.           END IF
  602.      NEXT j%
  603.      IF ICnt%=1 THEN  PRINT #6,CHR$(13);
  604.      PRINT #6,CHR$(0);CHR$(13);
  605.      CLOSE #6
  606.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  607.      RETURN
  608.  
  609.  
  610.  
  611. "Export_Message"
  612.  
  613.      a%=CVI(CHR$(PEEK(MEM(0+40)+x&+200))):GOSUB "Date_Convert":Month$=a$
  614.      a%=CVI(CHR$(PEEK(MEM(0+40)+x&+201))):GOSUB "Date_Convert":Day$=a$
  615.      a%=CVI(CHR$(PEEK(MEM(0+40)+x&+202))):GOSUB "Date_Convert":Year$=a$
  616.      a%=CVI(CHR$(PEEK(MEM(0+40)+x&+203))):GOSUB "Date_Convert":Hour$=a$
  617.      a%=CVI(CHR$(PEEK(MEM(0+40)+x&+204))):GOSUB "Date_Convert":Minute$=a$
  618.      a%=CVI(CHR$(PEEK(MEM(0+40)+x&+205))):GOSUB "Date_Convert":Second$=a$
  619.             
  620.      To$="":From$="":Subject$="":Destination$=""
  621.      l%=CVI(CHR$(PEEK(MEM(0+40)+x&+46)))
  622.      EBytes&=EBytes&+l%
  623.      FOR k%=1 TO l%
  624.           To$=To$+CHR$(PEEK(MEM(0+40)+x&+46+k%))
  625.      NEXT k%
  626.      l%=CVI(CHR$(PEEK(MEM(0+40)+x&+14)))
  627.      EBytes&=EBytes&+l%
  628.      FOR k%=1 TO l%
  629.           From$=From$+CHR$(PEEK(MEM(0+40)+x&+14+k%))
  630.      NEXT k%
  631.      l%=CVI(CHR$(PEEK(MEM(0+40)+x&+78)))
  632.      EBytes&=EBytes&+l%
  633.      FOR k%=1 TO l%
  634.           Subject$=Subject$+CHR$(PEEK(MEM(0+40)+x&+78+k%))
  635.      NEXT k%
  636.      l%=CVI(CHR$(PEEK(MEM(0+40)+x&+120)))
  637.      EBytes&=EBytes&+l%
  638.      FOR k%=1 TO l%
  639.           Destination$=Destination$+CHR$(PEEK(MEM(0+40)+x&+120+k%))
  640.      NEXT k%
  641.  
  642.      LONG IF LEN(Subject$) < 37 AND (ASC(Status$) AND 2) = 2 AND UCASE$(LEFT$(Subject$,3)) <> "RE:"
  643.           Subject$="Re: "+Subject$
  644.      END IF
  645.  
  646.      ahold%=INSTR(1,Destination$,".")
  647.      LONG IF ahold% > 0
  648.           Point%=Point%+1
  649.           ppoint$=MID$(Destination$,ahold%+1,LEN(Destination$))
  650.           Destination$=LEFT$(Destination$,ahold%-1)
  651.      END IF
  652.  
  653.      FOR jc% = 0 TO AKACnt%
  654.            lj%=LEN(AKAName$(jc%))
  655.            LONG IF LEFT$(AKAName$(jc%),lj%) = UCASE$(Destination$)
  656.                 Destination$=AKANode$(jc%)
  657.                 jc%=999
  658.             END IF
  659.      NEXT jc%
  660.     
  661.      LONG IF MessageType%=3 
  662.           Byte2$="M"
  663.           Catagory$="000"
  664.      XELSE
  665.           Byte2$="E"
  666.           Catagory$=STR$(Section%)
  667.           Catagory$=RIGHT$(Catagory$,LEN(Catagory$)-1)
  668.           LONG IF LEN(Catagory$)<3
  669.                FOR k%=LEN(Catagory$) TO 2
  670.                     Catagory$="0"+Catagory$
  671.                NEXT k%
  672.           END IF
  673.       END IF
  674.  
  675.       LONG IF ((ASC(Status$) AND 1) = 1)
  676.            Byte1$="D":     ' If message is flagged for delete Byte1 $= "D"
  677.       XELSE
  678.            Byte1$="."      ' If message is active the Byte1$ = blank space
  679.       END IF
  680.  
  681.       Byte3$="."          ' Not used
  682.     
  683.       LONG IF SkipExport%=2 AND MessageType%=4
  684.            file%=4
  685.       XELSE
  686.            file%=5
  687.       END IF
  688.  
  689.       LSeen&=LOF(4,1)
  690.  
  691.       ERROR = 0:ErrCode%=21
  692.  
  693.       PRINT #file%,Byte1$;Byte2$;Byte3$;CHR$(13);
  694.       PRINT #file%,Catagory$;CHR$(13);
  695.       Hold$=Month$+"/"+Day$+"/"+Year$
  696.       PRINT #file%,Hold$;CHR$(13);
  697.       Hold$=Hour$+":"+Minute$+":"+Second$
  698.       PRINT #file%,Hold$;CHR$(13);
  699.       PRINT #file%,Destination$;CHR$(13);
  700.       PRINT #file%,From$;CHR$(13);
  701.       PRINT #file%,To$;CHR$(13);
  702.       PRINT #file%,Subject$;CHR$(13);
  703.       IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  704.  
  705.       MessageSize&=MessageOffSet&
  706.       EBytes&=EBytes&+MessageLength&+9
  707.       ERROR = 0 :ErrCode%=22
  708.       RECORD #2,0,MessageOffSet&
  709.       READ FILE #2,MEM(1+40),MessageLength&
  710.       IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  711.  
  712.       ERROR = 0 :ErrCode%=23
  713.       LONG IF ahold% > 0
  714.            MsgLine$=CHR$(1)+"TOPT "+ppoint$
  715.            PRINT #file%,MsgLine$;CHR$(13);
  716.       END IF
  717.       IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  718.  
  719.       y&=0
  720.       ERROR = 0 :ErrCode%=24
  721.       WHILE MessageSize& < MessageOffSet&+MessageLength&
  722.               MsgLine$=""
  723.            l%=CVI(CHR$(PEEK(MEM(1+40)+y&)))
  724.               FOR k% = 1 TO l%
  725.                 MsgLine$=MsgLine$+CHR$(PEEK(MEM(1+40)+y&+k%))
  726.               NEXT k%
  727.            PRINT #file%,MsgLine$;CHR$(13);
  728.            MessageSize&=MessageSize&+1+l%
  729.               y&=y&+1+l%
  730.       WEND
  731.       IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  732.  
  733.       LONG IF MessageType%=3 AND b%(4) = 2
  734.            LONG IF UCASE$(To$) <> "AREAFIX"
  735.                 ERROR = 0:ErrCode%=25
  736.                 PRINT #file%," ";CHR$(13);
  737.                 ExMsg$="--- Export 3.21"
  738.                 IF ahold% > 0 THEN ExMsg$=ExMsg$+"/Point"
  739.                 PRINT #file%,ExMsg$;CHR$(13);
  740.                 PRINT #file%,OriginLine$;CHR$(13);
  741.                 IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  742.            END IF
  743.       END IF
  744.       LONG IF MessageType% = 4
  745.             ERROR = 0 :ErrCode%=26
  746.             IF b%(5) <> 2 AND file% = 4 THEN PRINT #file%," ";CHR$(13);
  747.             LONG IF b%(5) = 2
  748.                  PRINT #file%," ";CHR$(13);
  749.                  FOR js% = 1 TO 10
  750.                       LONG IF UCASE$(LEFT$(Sign$(js%),4)) <> "NONE"
  751.                            PRINT #file%,Sign$(js%);CHR$(13);
  752.                            SFlag%=1
  753.                       END IF
  754.                  NEXT js%
  755.             END IF
  756.             LONG IF file%=4
  757.                  IF SFlag%=1 THEN PRINT #file%," ";CHR$(13);
  758.                  ExMsg$="--- Tabby "+TabbyVersion$+"/Export 3.21"
  759.                  IF ahold% > 0 THEN ExMsg$=ExMsg$+"/Point"
  760.                  PRINT #file%,ExMsg$;CHR$(13);
  761.                  PRINT #file%,OriginLine$;CHR$(13);
  762.             END IF
  763.        END IF
  764.        PRINT #file%,CHR$(0);CHR$(13);
  765.        IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  766.  
  767.        LONG IF file%=4
  768.             ERROR = 0:ErrCode%=27
  769.             bhold$=STR$(LSeen&):bhold$=RIGHT$(bhold$,LEN(bhold$)-1)
  770.             PRINT #7,"|";Catagory$;"|n";bhold$;"|SEEN_BY: ";TAddress$;CHR$(13);
  771.             PRINT #7,"PATH: ";TAddress$;CHR$(13);
  772.             PRINT #7,CHR$(0);CHR$(13);
  773.             IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  774.        END IF
  775.        LONG IF MessageType%=3
  776.             NetCount%=NetCount%+1
  777.        XELSE
  778.             EchoCount%=EchoCount%+1
  779.        END IF  
  780.        ExportCount&=ExportCount&+1
  781.        ExportCount%(Section%)=ExportCount%(Section%)+1
  782.          
  783.           RETURN
  784.  
  785.  
  786. "Get_Resource_Values"
  787.  
  788.      ' COMMENTS
  789.      ' Last Modified, by Michael Lininger on 12-22-89.
  790.  
  791.      ' This sub-routine Gets default values from STR resources
  792.      ' 1 is inactive, 2 is active
  793.  
  794.      ' 1230 = BBS Application Name (Red Ryder Host)
  795.      ' 1231 = BBS Folder Pathname (dd80:bbs:)
  796.      ' 1232 = ImExport Log Full Pathname (dd80:bbs:Log:ImExport Log)
  797.      ' 1233 = value for last Message Number processed (9650)
  798.      ' 1234 = value for Netmail Message Section Number (11)
  799.      ' 1235 = b%(1) Process All
  800.      ' 1236 = b%(2) Delete Netmail
  801.      ' 1237 = b%(3) Notify Sysop
  802.      ' 1238 = b%(4) Append Origin/NetMail
  803.      ' 1239 = b%(5) Append Signature/EchoMail
  804.      ' 1240 = b%(6) Activate Reports
  805.      ' 1241 = b%(7) Use Full Reports
  806.      ' 1242 = b%(8) Erase Log
  807.      ' 1243 - 1252 = Signature #1 - #10
  808.      ' 1253 - 1257  Holding Area for last five Export Stats
  809.      ' 1258 = Skip Generic Export Flag
  810.      ' 1259 = AKA File Name/Location
  811.  
  812.      ' ----- End Comment
  813.  
  814.      Tabby$="TabbyNet"
  815.      TRefnum%=FN OPENRESFILE(Tabby$)
  816.      Errnum%=FN RESERROR
  817.      LONG IF Errnum% <> 0
  818.           TabbyVersion$=""
  819.           GOTO "Res_Load"
  820.      END IF 
  821.  
  822.      StrHnd&=FN GETRESOURCE(CVI("TABY"),0)
  823.      LONG IF StrHnd&=0
  824.           CALL CLOSERESFILE(TRefnum%)
  825.           TabbyVersion$=""
  826.           GOTO "Res_Load"
  827.      END IF
  828.  
  829.      HoldingArea$=FN ReturnString$(StrHnd&)
  830.      x%=VAL(HoldingArea$)
  831.      x%=INSTR(1,HoldingArea$,".")
  832.      LONG IF MID$(HoldingArea$,x%+2,1) = "."
  833.           y$=MID$(HoldingArea$,x%+3,2):y%=VAL(y$):y$=STR$(y%)
  834.           TabbyMantissa$=RIGHT$(y$,LEN(y$)-1)
  835.           Mantissa%=1
  836.      END IF
  837.      x$=MID$(HoldingArea$,x%-2,5)
  838.      x! = VAL(x$)
  839.      x$=STR$(x!)
  840.      TabbyVersion$=RIGHT$(x$,LEN(x$)-1)
  841.      IF x! > 4.5 OR x! < 2.1 THEN TabbyVersion$="x.x"
  842.      IF Mantissa%=1 THEN TabbyVersion$=TabbyVersion$+"."+TabbyMantissa$
  843.  
  844.      CALL CLOSERESFILE(TRefnum%)
  845.  
  846.  
  847. "Res_Load"
  848.  
  849.      ' Find out what this application is named
  850.       GOSUB "Cursor_Spin"
  851.       CurApName=&H910
  852.       CurApName$=""
  853.  
  854.       FOR I%=1 TO PEEK(CurApName)
  855.                  CurApName$=CurApName$+CHR$(PEEK(CurApName+I%))
  856.       NEXT I%
  857.  
  858.       rscs%=0:' ResFile is Closed
  859.       Refnum%=FN OPENRESFILE(CurApName$)
  860.       Errnum%=FN RESERROR
  861.  
  862.       LONG IF Errnum% <> 0
  863.            ErrCode%=99
  864.            GOSUB "Error Log"
  865.            GOSUB "Tabby_Launch"
  866.            RESET
  867.            END
  868.      END IF 
  869.  
  870.      rscs%=1:' ResFile is Open
  871.      FOR ResourceCount%=1230 TO 1259
  872.           GOSUB "Cursor_Spin"
  873.           StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  874.           LONG IF StrHnd&=0
  875.  
  876.               ' Setting up string resource to save default strs
  877.               IF ResourceCount% = 1230 THEN Str$="Red Ryder Host"
  878.               IF ResourceCount% = 1231 THEN Str$=":"
  879.               IF ResourceCount% = 1232 THEN Str$="Report Log"
  880.               IF ResourceCount% = 1233 THEN Str$="0"
  881.               IF ResourceCount% = 1234 THEN Str$="1"
  882.               LONG IF ResourceCount% >= 1235 AND ResourceCount% <= 1242
  883.                    Str$="1"
  884.               END IF
  885.               LONG IF ResourceCount% >= 1243 AND ResourceCount% <= 1252
  886.                    Str$="NONE"
  887.               END IF
  888.               LONG IF ResourceCount% >= 1253 AND ResourceCount% <= 1257
  889.                    Str$="Blank"
  890.               END IF
  891.               LONG IF ResourceCount% = 1258
  892.                    Str$="1"
  893.               END IF
  894.               LONG IF ResourceCount% = 1259
  895.                    Str$="ExAKA Nodes"
  896.               END IF
  897.               
  898.                  StrHnd&=FN NEWSTRING(Str$)
  899.                  CALL ADDRESOURCE (StrHnd&,CVI("STR "),ResourceCount%,"")
  900.           XELSE
  901.                   StrHnd&=FN GETSTRING(ResourceCount%)
  902.           END IF
  903.  
  904.           ' Convert STRs into useful limit values and pathnames
  905.           Default$=FN ReturnString$(StrHnd&)
  906.      
  907.           IF ResourceCount% = 1230 THEN RRHost$=Default$
  908.           IF ResourceCount% = 1231 THEN BBSFolder$=Default$
  909.           IF ResourceCount% = 1232 THEN ReportLog$=Default$
  910.           IF ResourceCount% = 1233 THEN OldHighMessage&=VAL(Default$):OldHighMessage$=Default$
  911.           IF ResourceCount% = 1234 THEN NetMailArea%=VAL(Default$):NetMailArea$=Default$
  912.          
  913.           LONG IF ResourceCount% >= 1235 AND ResourceCount% <= 1242
  914.                b%(ResourceCount%-1234)=VAL(Default$)
  915.           END IF
  916.           LONG IF ResourceCount% >= 1243 AND ResourceCount% <= 1252
  917.                Sign$(ResourceCount%-1242) = Default$
  918.           END IF
  919.           LONG IF ResourceCount% >= 1253 AND ResourceCount% <= 1257
  920.                b$(ResourceCount%-1252) = Default$
  921.           END IF
  922.           IF ResourceCount% = 1258 THEN SkipExport% = VAL(Default$)
  923.           IF ResourceCount% = 1259 THEN AKAFile$ = Default$
  924.  
  925.      NEXT ResourceCount%
  926.  
  927.      RETURN
  928.  
  929.  
  930. "Get_Tabby_Files"
  931.  
  932.      ' COMMENTS
  933.      ' Last Modified, by Michael Lininger on 12-22-89.
  934.  
  935.      ' This sub-routine reads in the various tabby files from the disk.
  936.      ' Tabby Files Used:   Tabby Config - Node Address
  937.      '                     Generic - Path to Generic Export Folder
  938.      '                     Areas.bbs - Origin Line
  939.  
  940.      ' ----- End Comment
  941.    
  942.      ErrCode%=28:   ' sets Export error code
  943.      ERROR = 0:     ' sets ERROR bit to Zero/No error has occured
  944.  
  945.      ' Open GENERIC file,and read in the Path to the Generic Export file
  946.      OPEN "I",1,GenericFile$
  947.           INPUT #1,GenericFile$
  948.      CLOSE #1
  949.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  950.  
  951.      ErrCode%=28:   ' sets Export error code
  952.      ERROR = 0:     ' sets ERROR bit to Zero/No error has occured
  953.  
  954.      ' Open TABBY CONFIG file, and read in the Path to the Node Address file
  955.      OPEN "I",1,TabbyConfig$
  956.           LINE INPUT #1,OAddress$
  957.           TAddress$=MID$(OAddress$,3,LEN(OAddress$))
  958.           ' TAddress$ is used if you ship Generic Export and go right to the Generic Ehcoes
  959.      CLOSE #1
  960.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  961.  
  962.      ErrCode%=29:   ' sets Export error code
  963.      ERROR = 0:     ' sets ERROR bit to Zero/No error has occured
  964.  
  965.      ' Open Areas.bbs file, and read in the Origin Line for the system
  966.      OPEN "I",1,TabbyAreas$
  967.           LINE INPUT #1,Origin2$
  968.      CLOSE #1
  969.      IF ERROR <> 0 THEN ErrHold%=ERROR:GOSUB "ERROR_Check"
  970.  
  971.      OriginLine$ = " * Origin: "+Origin2$+" ("+OAddress$+")"
  972.  
  973.      ERROR = 0
  974.      AKACnt%=0
  975.      OPEN "I",1,AKAFile$
  976.      IF ERROR <> 0 THEN GOTO "AKA_Skip"
  977.      WHILE NOT EOF(1)
  978.           LINE INPUT #1,lin$
  979.           x%=INSTR(1,lin$,":")
  980.           AKAName$(AKACnt%) = UCASE$(LEFT$(lin$,x%-1))
  981.           AKANode$(AKACnt%) = MID$(lin$,x%+1,LEN(lin$))
  982.           AKACnt%=AKACnt%+1
  983.           IF AKACnt% = 100 THEN CLOSE #1:GOTO "AKA_Skip"
  984.      WEND
  985.      CLOSE #1
  986.  
  987. "AKA_Skip"
  988.  
  989.      ERROR = 0
  990.      RETURN
  991.  
  992.  
  993.  
  994. "Error Log"
  995.  
  996.      ' Writes a text file, listing the Error that happended
  997.      DEF OPEN "TEXTEDIT"
  998.      OPEN "A",9,"Export.Error"
  999.           PRINT #9,"  <<Application Error Codes>> -  ";Errhold%;",";ErrCode%
  1000.           PRINT #9,"<<Application Error Message>> -  ";ERRMSG$(Errhold%)
  1001.           PRINT #9,"        <<System Error Code>> -  ";SYSERROR
  1002.           PRINT #9,"              <<Free Memory>> -  ";MEM(-1)
  1003.           PRINT #9," "
  1004.           PRINT #9,"Below is a list of files used by Export 3.x and their locations,"
  1005.           PRINT #9,"as configured from Export, Config, Generic, Messages.  Check to"
  1006.           PRINT #9,"make sure they have the correct setting in Config, Export, Generic"
  1007.           PRINT #9,"and the Messages files.  Also See Export 3.x Error Codes for info."
  1008.           PRINT #9," "
  1009.           PRINT #9,"    BBS Folder - ";BBSFolder$
  1010.           PRINT #9,"   Launch Appl - ";BBSFolder$;Tabby$(0)
  1011.           PRINT #9,"    Report Log - ";ReportLog$
  1012.           PRINT #9,"  ExAKA Nodes* - ";AKAFile$
  1013.           PRINT #9,"      Messages - ";MessagesFile$
  1014.           PRINT #9,"        Config - ";ConfigFile$
  1015.           PRINT #9,"      Host App - ";RRHost$
  1016.           PRINT #9," TabbyNet App* - ";TabbyNet$
  1017.           PRINT #9,"     Areas.bbs - ";TabbyAreas$
  1018.           PRINT #9,"  Tabby Config - ";TabbyConfig$
  1019.           PRINT #9,"  Launch.Next* - ";NextLaunch$
  1020.           PRINT #9,"Generic Folder - ";GenericFile$
  1021.           PRINT #9,"Generic Export - ";GExport$
  1022.           PRINT #9,"Generic Import - ";GImport$
  1023.           PRINT #9,"Generic Echoes - ";GEchoes$
  1024.           PRINT #9,"    SeenBy.bbs - ";GSeenby$
  1025.           PRINT #9," "
  1026.           PRINT #9," * Indicates that Export DOES NOT need these to run, but warns"
  1027.           PRINT #9,"   you in the event they are not located."
  1028.           PRINT #9," "
  1029.           PRINT #9,"    Error Time - ";TIME$;" ";DATE$
  1030.           PRINT #9,"----------------"
  1031.      CLOSE #9
  1032.      RETURN
  1033.      
  1034.  
  1035.  
  1036. "Cursor_Spin"
  1037.  
  1038.      ' Changes Cursor, spinning beach ball
  1039.      Cur%=Cur%+1
  1040.      IF Cur% > 131 THEN Cur%=128
  1041.      CURSOR Cur%
  1042.  
  1043.      RETURN
  1044.  
  1045.  
  1046.  
  1047. "Date_Convert"
  1048.  
  1049.      ' Pad 1 digit dates/times with a leading Zero
  1050.       a$=STR$(a%):a$=RIGHT$(a$,LEN(a$)-1)
  1051.          LONG IF LEN(a$) < 2
  1052.               a$="0"+a$
  1053.          END IF
  1054.  
  1055.          RETURN
  1056.  
  1057.  
  1058.  
  1059. "Build_Main_Window"
  1060.  
  1061.      ' Builds Main Logo Window, at run time and displays Logo PICT
  1062.      GOSUB "Cursor_Spin"
  1063.      WINDOW 1,"",(333,40)-(489,87),4
  1064.      Pict3&=FN GETRESOURCE(CVI("PICT"),212)
  1065.      PICTURE(0,0),Pict3&
  1066.      CALL PENNORMAL
  1067.      PEN 1,1,1,8,19
  1068.      CIRCLE FILL 130,23,14
  1069.  
  1070.      RETURN
  1071.  
  1072.  
  1073. "ERROR_Check"
  1074.  
  1075.      GOSUB "Error Log"
  1076.      LONG IF LErr%=1
  1077.           RUN RRHost$
  1078.           END
  1079.      END IF
  1080.      GOSUB "Tabby_Launch"
  1081.      END
  1082.    
  1083.      RETURN
  1084.  
  1085.  
  1086.  
  1087.  
  1088. "Config_Read"
  1089.  
  1090.      ' COMMENTS
  1091.      ' Last Modified, by Michael Lininger on 12-22-89.
  1092.  
  1093.      ' This sub-routine reads in the RRH/SS CONFIG file from the disk and
  1094.      ' determines where the MESSAGES, CALLERLOG, USERLOG are;  and what the
  1095.      ' the default Sysop Name is.
  1096.      ' See pages 116 and 117 of the RRH/SS Manual for file structure.
  1097.  
  1098.      ' ----- End Comment
  1099.  
  1100.  
  1101.      ErrCode%=30: ' sets Export error code
  1102.      ERROR = 0:   ' sets ERROR bit to Zero/No error has occured
  1103.  
  1104.      ' Open CONFIG file, position pointer and read variables of interest
  1105.      OPEN "N",6,ConfigFile$
  1106.      Ln&=LOF(6,1)
  1107.      LONG IF Ln& = 0
  1108.           CLOSE #6
  1109.           Errhold%=ERROR
  1110.           MessagesFile$="Invalid Config File - "+ConfigFile$+" -"+STR$(Ln&)
  1111.           GOSUB "ERROR_Check"
  1112.      END IF
  1113.      RECORD #6,0,0: ' Position pointer to start of file
  1114.      READ #6, Ignore$;57
  1115.      READ #6, UserLog$;41
  1116.      READ #6, CallerLog$;41
  1117.      READ #6, MessagesPath$;80
  1118.      READ #6, Ignore$;98
  1119.      READ #6, SysopName$;31
  1120.         CLOSE #6
  1121.  
  1122.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  1123.      
  1124.      ' These checks are to see if variable$ has any length to it. If so 
  1125.      ' then we Call Function MakeString, which converts the pascal string 
  1126.      ' into a form understandable by ZBasic.
  1127.  
  1128.      ' We get the path to the MESSAGES file here
  1129.      LONG IF ASC(LEFT$(MessagesPath$,1)) > 0 
  1130.           MessagesFile$=FN MakeString$(MessagesPath$)+":MESSAGES"
  1131.      XELSE
  1132.           MessagesFile$=BBSFolder$+"MESSAGES": ' Default location
  1133.      END IF 
  1134.  
  1135.      ' We get the path to the CallerLog file here
  1136.      LONG IF ASC(LEFT$(CallerLog$,1)) > 0
  1137.           CallerLog$=FN MakeString$(CallerLog$)+":CallerLog"
  1138.      XELSE
  1139.           Callerlog$="": ' No CallerLog file being used
  1140.      END IF
  1141.  
  1142.      ' We get the path to the UserLog file here
  1143.      LONG IF ASC(LEFT$(UserLog$,1)) > 0
  1144.           UserLog$=FN MakeString$(UserLog$)+":UserLog"
  1145.      XELSE
  1146.           UserLog$=BBSFolder$+"UserLog": ' Default location
  1147.      END IF
  1148.  
  1149.      ' We get the Sysop Name here
  1150.      LONG IF ASC(LEFT$(SysopName$,1)) > 0
  1151.           SysopName$=FN MakeString$(SysopName$)
  1152.      XELSE
  1153.           SysopName$="System Operator": ' Default Sysop Name
  1154.      END IF
  1155.  
  1156.      RETURN
  1157.  
  1158. "Messages_Read"
  1159.  
  1160.      ' COMMENTS
  1161.      ' Last Modified, by Michael Lininger on 12-22-89.
  1162.  
  1163.      ' This sub-routine reads in the RRH/SS MESSAGES file from the disk and
  1164.      ' determines where the MSGHDR and MSGTXT file are located;  what the
  1165.      ' various message section names are and what TYPE each section is.
  1166.      ' See pages 118 and 119 of the RRH/SS Manual for file structure.
  1167.  
  1168.      ' ----- End Comment
  1169.  
  1170.      ' Clear a block of memory so MESSAGES file can be read in, with 1 read
  1171.      ERROR = 0
  1172.      ErrCode%=31:  ' sets Export error code
  1173.      CLEAR 9242,3
  1174.  
  1175.      ' Open MESSAGES file, position pointer, block read and close file
  1176.      OPEN "N",6,MessagesFile$
  1177.      Ln&=LOF(6,1)
  1178.      LONG IF Ln& <> 9242
  1179.           CLOSE #6
  1180.           Errhold%=ERROR
  1181.           MessagesFile$="Invalid Messages File - "+MessagesFile$+" -"+STR$(Ln&)
  1182.           GOSUB "ERROR_Check"
  1183.      END IF
  1184.      RECORD #6,0,0
  1185.      READ FILE #6,MEM(3+40),9242
  1186.      CLOSE #6
  1187.      IF ERROR <> 0 THEN Errhold%=ERROR:GOSUB "ERROR_Check"
  1188.      ' Determine where the MSGHDR and MSGTXT file are located
  1189.      MsgPath$=""
  1190.      a%=CVI(CHR$(PEEK(MEM(3+40)))):' Gets the length of the MsgPath Name
  1191.      FOR j%=1 TO a%
  1192.           MsgPath$=MsgPath$+CHR$(PEEK(MEM(3+40)+j%))
  1193.      NEXT j%
  1194.  
  1195.      ' Get Low, High and TotalBytes from the MESSAGES file
  1196.      LowMessage&=PEEK LONG(MEM(3+40)+50)
  1197.      HighMessage&=PEEK LONG(MEM(3+40)+54)
  1198.      MsgTxtBytes&=PEEK LONG(MEM(3+40)+58)
  1199.  
  1200.      ' Determine message section names and message section type. 1 - 255
  1201.      ' possible sections
  1202.      x&=62: ' OffSet position within the MESSAGES file
  1203.      FOR j%=1 TO 255
  1204.           SectionType%=CVI(CHR$(PEEK(MEM(3+40)+x&+35)))
  1205.           LONG IF SectionType% > 0
  1206.                a%=CVI(CHR$(PEEK(MEM(3+40)+x&)))
  1207.                LONG IF a% > 0
  1208.                     FOR k%=1 TO a%
  1209.                          MsgName$(j%)=MsgName$(j%)+CHR$(PEEK(MEM(3+40)+x&+k%))
  1210.                     NEXT k%
  1211.                END IF
  1212.                MessageSection$(j%)=RIGHT$(STR$(SectionType%),1)
  1213.           XELSE
  1214.                MsgName$(j%)=""
  1215.           END IF
  1216.           x&=x&+36: 'Increase OffSet. Each message section is 36 bytes long
  1217.      NEXT j%
  1218.      GOSUB "Cursor_Spin"
  1219.        
  1220.      MsgHdrFilename$=MsgPath$+":"+"MSGHDR": ' Path to MSGHDR file
  1221.      MsgTxtFilename$=MsgPath$+":"+"MSGTXT": ' Path to MSGTXT file
  1222.  
  1223.      RETURN
  1224.  
  1225.  
  1226. "Tabby_Launch"
  1227.  
  1228.      ' COMMENTS
  1229.      ' Last Modified, by Michael Lininger on 12-22-89.
  1230.  
  1231.      ' This sub-routine reads in the launch.next file from the disk and
  1232.      ' determines the next application to be launched.  If it is not the last
  1233.      ' application in the chain a new launch.next file is written to the
  1234.      ' disk for the next application to use, after it has been launched.
  1235.      ' If it is the last application in the chain then the launch.next file
  1236.      ' is deleted from the disk.
  1237.  
  1238.      ' ----- End Comment
  1239.  
  1240.      RESET: ' Make sure all file are closed
  1241.      IF rscs%=1 THEN rscs%=0:CALL CLOSERESFILE(Refnum%)
  1242.      GOSUB "Cursor_Spin"
  1243.      EventCount%=0: ' sets the number of events in launch.next to 0
  1244.      ErrCode%=32:   ' sets Export error code
  1245.      ERROR = 0:     ' sets ERROR bit to Zero/No error has occured
  1246.  
  1247.      ' Make a Lunch.next file exists
  1248.      OPEN "R",1,NextLaunch$
  1249.           Length&=LOF(1,1)
  1250.      CLOSE #1
  1251.      IF ERROR <> 0 THEN LErr%=1:Errhold%=ERROR:GOSUB "ERROR_Check"
  1252.  
  1253.      ' If Launch.next file does not exist then jump to Launch_RRH Routine
  1254.      LONG IF Length&=0
  1255.           KILL NextLaunch$
  1256.           NextLaunch$="Launch.next file was not found - "+NextLaunch$
  1257.           GOSUB "Error Log"
  1258.           GOTO "Launch_RRH"
  1259.      END IF
  1260.  
  1261.      ' Read in event chain into Tabby$()
  1262.      ERROR = 0:ErrCode%=33
  1263.      OPEN "I",1,NextLaunch$
  1264.      WHILE NOT EOF(1)
  1265.           GOSUB "Cursor_Spin"
  1266.           INPUT #1,Tabby$(EventCount%)
  1267.           EventCount%=EventCount%+1
  1268.      WEND
  1269.      CLOSE #1
  1270.      IF ERROR <> 0 THEN LErr%=1:Errhold%=ERROR:GOSUB "ERROR_Check"
  1271.  
  1272.      GOSUB "Cursor_Spin"
  1273.      EventCount%=EventCount%-1
  1274.      ERROR = 0:     ' sets ERROR bit to Zero/No error has occured
  1275.  
  1276.      ' If EventCount% = 0 then this is the last event, delete Launch.next file
  1277.      ' Else write Launch.next file back to disk, minus the first event which
  1278.      ' is going to be launched next.
  1279.      LONG IF EventCount% < 1
  1280.           ErrCode%=34:    ' sets Export error code
  1281.           KILL NextLaunch$
  1282.           IF ERROR <> 0 THEN LErr%=1:Errhold%=ERROR:GOSUB "ERROR_Check"
  1283.      XELSE
  1284.           ErrCode%=35:    ' sets Export error code
  1285.           OPEN "O",1,NextLaunch$
  1286.           FOR Count% = 1 TO EventCount%
  1287.               PRINT #1,Tabby$(Count%);
  1288.               GOSUB "Cursor_Spin"
  1289.               LONG IF Tabby$(Count%+1) = ""
  1290.                    PRINT #1,CHR$(13);
  1291.               XELSE
  1292.                    PRINT #1,",";
  1293.               END IF
  1294.           NEXT Count%
  1295.           CLOSE #1
  1296.      END IF
  1297.      IF ERROR <> 0 THEN LErr%=1:Errhold%=ERROR:GOSUB "ERROR_Check"
  1298.  
  1299.      ' Add BBS path to application to be launched
  1300.      ' If the Next Event = "BBS" then next file to launch to Red Ryder Host RRHost$
  1301.      LaunchFile$=BBSPath$+Tabby$(0)
  1302.      IF UCASE$(Tabby$(0)) = "BBS" THEN LaunchFile$=RRHost$
  1303.  
  1304.  
  1305.      ERROR = 0:     ' sets ERROR bit to Zero/No error has occured
  1306.      ErrCode%=36:   ' sets Export error code
  1307.  
  1308.      ' Checks to see if LaunchFile exists
  1309.      OPEN "I",2,LaunchFile$
  1310.      CLOSE #2
  1311.      ' If it does exist then launch it     
  1312.      LONG IF ERROR = 0
  1313.           RUN LaunchFile$
  1314.           END
  1315.      END IF
  1316.      GOSUB "Error Log"
  1317.  
  1318. "Launch_RRH"
  1319.  
  1320.      ERROR = 0:     ' sets ERROR bit to Zero/No error has occured
  1321.      ErrCode%=37:   ' sets Export error code
  1322.      
  1323.      ' Checks to see if RRHost exists
  1324.      OPEN "I",2,RRHost$
  1325.      CLOSE #2
  1326.      ' If it does exist then launch it
  1327.      LONG IF ERROR = 0
  1328.           RUN RRHost$
  1329.           END
  1330.      END IF
  1331.  
  1332.      ' last chance, of RRHost launch failed, drop to finder
  1333.      GOSUB "Error Log"
  1334.      Errhold%=999
  1335.      GOSUB "Error Log"
  1336.      END
  1337.     
  1338.      RETURN
  1339.  
  1340.  
  1341. SEGMENT
  1342. "Memory_Check"
  1343.  
  1344.      ' COMMENTS
  1345.      ' Last Modified, by Michael Lininger on 12-22-89.
  1346.  
  1347.      ' This sub-routine checks to make sure there is enough memory to run
  1348.      ' the application.  Every attempt is made to find the bare minimum
  1349.      ' memory needed to run the application.  
  1350.  
  1351.      ' ----- End Comment
  1352.  
  1353.  
  1354.     LONG IF m& > n&
  1355.         a&=329600
  1356.     XELSE
  1357.         n&=206000+overhead&
  1358.         LONG IF m& > n&
  1359.             a&=206000
  1360.         XELSE
  1361.             n&=164800+overhead&
  1362.             LONG IF m& > n&
  1363.                 a&=164800
  1364.             XELSE
  1365.                 n&=82400+overhead&
  1366.                 LONG IF m& > n&
  1367.                     a&=82400
  1368.                 XELSE
  1369.                     n&=41200+overhead&
  1370.                     LONG IF m& > n&
  1371.                         a&=41200
  1372.                     XELSE
  1373.                         n&=20600+overhead&
  1374.                         LONG IF m& > n&
  1375.                             a&=20600
  1376.                         XELSE
  1377.                              OPEN "A",9,"Export.Error"
  1378.                              PRINT #9,"*** Not Enough Memory *** "
  1379.                              PRINT #9,"*** Minimum Memory Needed:"+STR$(a&+overhead&) +" *** "
  1380.                              PRINT #9,"***  Max Memory Available:"+STR$(Memory&)+" *** "
  1381.                              CLOSE #9
  1382.                              GOSUB "Get_Resource_Values"
  1383.                              NextLaunch$=BBSFolder$+"Launch.Next"
  1384.                              TabbyNet$=BBSFolder$+"TabbyNet"
  1385.                              RRHost$=BBSFolder$+RRHost$
  1386.                              GOSUB "Tabby_Launch"
  1387.                              END 
  1388.                         END IF
  1389.                     END IF
  1390.                 END IF
  1391.             END IF
  1392.         END IF
  1393.     END IF
  1394.  
  1395.     SEGMENT RETURN
  1396.  
  1397.  
  1398. SEGMENT
  1399. "Configure_Menu"
  1400.  
  1401.      ' COMMENTS
  1402.      ' Last Modified, by Michael Lininger on 12-22-89.
  1403.  
  1404.      ' This sub-routine allows the user to configure export
  1405.  
  1406.      ' ----- End Comment
  1407.  
  1408.  
  1409.      Pict&=FN GETRESOURCE(CVI("PICT"),210) 
  1410.      Pict2&=FN GETRESOURCE(CVI("PICT"),211) 
  1411.      CURSOR 0
  1412.      TEXT 0,12,0,0
  1413.      wnd%=1:GOSUB "Build_Window"
  1414.      Field%=1
  1415.      ON DIALOG GOSUB "Handle_Dialog"
  1416.  
  1417. DIALOG ON
  1418. "Loop"
  1419. DIALOG OFF
  1420.  
  1421.      LONG IF Button%=1
  1422.           WINDOW CLOSE #1
  1423.           RETURN
  1424.      END IF
  1425.      LONG IF Button%=2
  1426.           GOSUB "Resource_Update"
  1427.           WINDOW CLOSE #1
  1428.           RETURN
  1429.       END IF
  1430.  
  1431. GOTO "Loop"
  1432.  
  1433.  
  1434. "Handle_Dialog"
  1435.  
  1436.      act%=DIALOG(0):ref%=DIALOG(act%)
  1437.  
  1438.      LONG IF act%=3
  1439.           LONG IF window%=3
  1440.                CALL TEDISPOSE(HelpHndl&)          :'Dump the field we created
  1441.                WINDOW CLOSE #3
  1442.           END IF
  1443.           WINDOW ref%
  1444.           window%=WINDOW(0)
  1445.           RETURN
  1446.      END IF
  1447.      IF act%=5 THEN FN FormatWnd(ref%):RETURN :'Window needs refreshing
  1448.      IF act%=11 THEN EDIT FIELD ref%
  1449.      LONG IF WINDOW(0)=1
  1450.           LONG IF act%=1 AND ref%=13
  1451.                Button%=2
  1452.           END IF
  1453.           LONG IF act%=1 AND ref%=15
  1454.                Button%=1
  1455.           END IF
  1456.           LONG IF act%=1 AND ref%=6
  1457.                LONG IF b%(6)=2
  1458.                     b%(6)=1
  1459.                     b%(7)=1
  1460.                     b%(8)=1
  1461.                XELSE 
  1462.                     b%(6)=2
  1463.                END IF
  1464.                BUTTON 6 ,b%(6)
  1465.                BUTTON 7 ,b%(7)
  1466.                BUTTON 8 ,b%(8)
  1467.           END IF
  1468.           LONG IF act%=1 AND ref% < 6 AND ref% > 0
  1469.                LONG IF b%(ref%)=2
  1470.                     b%(ref%)=1
  1471.                XELSE 
  1472.                     b%(ref%)=2
  1473.                END IF
  1474.                BUTTON ref% ,b%(ref%)
  1475.           END IF
  1476.  
  1477.           LONG IF act%=1 AND ref%=7 OR ref%=8
  1478.                LONG IF b%(ref%)=2
  1479.                     b%(ref%)=1
  1480.                XELSE 
  1481.                     b%(6)=2
  1482.                     b%(ref%)=2
  1483.                END IF
  1484.                BUTTON 6 ,b%(6)
  1485.                BUTTON ref% ,b%(ref%)
  1486.           END IF
  1487.           LONG IF act%=1 AND ref%=17
  1488.                LONG IF SkipExport%=2
  1489.                    SkipExport%=1
  1490.                XELSE 
  1491.                     SkipExport%=2
  1492.                END IF
  1493.                BUTTON 17 ,SkipExport%
  1494.           END IF
  1495.           LONG IF act%=1 AND ref%=9
  1496.                F$=FILES$(1,"APPL",,WD)
  1497.                RRHost$=F$
  1498.                Temp$=FN ConvertWDRef$(F$,WD)          :'Get path name from function
  1499.                FOR jp% = LEN(Temp$) TO 1 STEP -1
  1500.                     LONG IF MID$(Temp$,jp%,1)=":"
  1501.                          Temp$ = LEFT$(Temp$,jp%)
  1502.                          jp%=0
  1503.                     END IF
  1504.                NEXT jp%
  1505.                BBSFolder$=Temp$
  1506.                EDIT FIELD #1,RRHost$
  1507.                EDIT FIELD #2,BBSFolder$
  1508.                Field%=2
  1509.           END IF
  1510.           LONG IF act%=1 AND ref%=10
  1511.                F$=FILES$(1,"APPL",,WD)
  1512.                Temp$=FN ConvertWDRef$(F$,WD)
  1513.                FOR jp% = LEN(Temp$) TO 1 STEP -1
  1514.                     LONG IF MID$(Temp$,jp%,1)=":"
  1515.                          Temp$ = LEFT$(Temp$,jp%)
  1516.                          jp%=0
  1517.                     END IF
  1518.                NEXT jp%
  1519.                BBSFolder$=Temp$
  1520.                EDIT FIELD #2,BBSFolder$
  1521.                Field%=2
  1522.           END IF
  1523.           LONG IF act%=1 AND ref%=11
  1524.                F$=FILES$(1,"TEXT",,WD)
  1525.                Temp$=FN ConvertWDRef$(F$,WD)
  1526.                ReportLog$=Temp$
  1527.                EDIT FIELD #3,ReportLog$
  1528.                Field%=3
  1529.           END IF
  1530.           LONG IF act%=1 AND ref%=12
  1531.                name$=FILES$(1,"MSGS",,volume%)
  1532.                LONG IF name$ = ""
  1533.                     HighMessage&=0
  1534.                XELSE
  1535.                     OPEN "N",9,name$,9242,volume%
  1536.                     READ #9,trash$;54
  1537.                     READ #9,HighMessage&
  1538.                     CLOSE #9
  1539.                END IF
  1540.                OldHighMessage$=STR$(HighMessage&)
  1541.                EDIT FIELD #4,OldHighMessage$
  1542.                Field%=4
  1543.           END IF
  1544.  
  1545.           LONG IF act%=1 AND ref%=14
  1546.                RRHost$=EDIT$(1)
  1547.                BBSFolder$=EDIT$(2)
  1548.                ReportLog$=EDIT$(3)
  1549.                OldHighMessage$=EDIT$(4)
  1550.                NetMailArea$=EDIT$(5)
  1551.                WINDOW CLOSE #1
  1552.                wnd%=2
  1553.                GOSUB "Build_Window"
  1554.           END IF
  1555.           LONG IF act%=1 AND ref%=16
  1556.                WINDOW 3,"Export Help/About",(156,60)-(500,298),17
  1557.                TEXT 3,9,0,0
  1558.                PRINT "      Memory ";MEM(-1) 
  1559.  
  1560.                t%=0:l%=0:b%=WINDOW(3)-30:r%=WINDOW(2)-1
  1561.                CALL INSETRECT(t%,20,20)
  1562.                NextBtn%=17
  1563.                PICTURE (92,195),Pict2&
  1564.                FN ScrollingHelp(VARPTR(t%),300,NextBtn%)
  1565.                window%=WINDOW(0)
  1566.                TEXT 0,12,0,0
  1567.           END IF
  1568.  
  1569.           LONG IF act%=6 OR act%=7
  1570.                Field%=Field%+1
  1571.                IF Field%>5 THEN Field%=1
  1572.                EDIT FIELD #Field%
  1573.           END IF
  1574.           LONG IF act%=2
  1575.                EDIT FIELD #ref%
  1576.                Field%=ref%
  1577.           END IF
  1578.      END IF
  1579.  
  1580.      LONG IF WINDOW(0)=2
  1581.  
  1582.           LONG IF act%=1 AND ref%=1 OR act%=4
  1583.                WINDOW CLOSE #2
  1584.                wnd%=1
  1585.                GOSUB "Build_Window"
  1586.           END IF
  1587.           LONG IF act%=1 AND ref%=2
  1588.                FOR jp% = 1 TO 10
  1589.                     Sign$(jp%)=EDIT$(jp%)
  1590.                NEXT jp%
  1591.                WINDOW CLOSE #2
  1592.                wnd%=1
  1593.                GOSUB "Build_Window"
  1594.           END IF
  1595.           LONG IF act%=6 OR act%=7
  1596.                Field%=Field%+1
  1597.                IF Field%>10 THEN Field%=1
  1598.                EDIT FIELD #Field%
  1599.           END IF
  1600.           LONG IF act%=2
  1601.                EDIT FIELD #ref%
  1602.                Field%=ref%
  1603.           END IF
  1604.      END IF
  1605.  
  1606.      LONG IF WINDOW(0)=3
  1607.           LONG IF act% = 1 OR act%=4
  1608.                LONG IF ref%=HelpBtn% OR act%=4
  1609.                     CALL TEDISPOSE(HelpHndl&)
  1610.                     WINDOW CLOSE #3
  1611.                     GOTO "Dialog_End"
  1612.                END IF
  1613.                BtnPos%=BUTTON(ref%)-1 
  1614.                SelPos%=PEEK WORD(PEEK LONG(HelpHndl&)+94+BtnPos%*2)
  1615.                CALL TESETSELECT(SelPos%,SelPos%,HelpHndl&)
  1616.                CALL TESELVIEW(HelpHndl&)
  1617.           END IF
  1618.      END IF
  1619.  
  1620. "Dialog_End"
  1621.  
  1622.      wnd%=WINDOW(0)
  1623.      window%=WINDOW(0)
  1624.  
  1625.      RETURN
  1626.  
  1627.  
  1628. "Frame_Button"
  1629.      CALL INSETRECT(t%,-4,-4)
  1630.      PEN 3,3,1,8,0
  1631.      CALL FRAMEROUNDRECT(t%,16,16)
  1632.      CALL INSETRECT(t%,4,4):CALL PENNORMAL
  1633.      RETURN
  1634.  
  1635.  
  1636. "Build_Window"
  1637.  
  1638.      IF wnd%=1 THEN WINDOW 1,"",(0,15)-(520,343),3
  1639.      IF wnd%=2 THEN WINDOW 2,"Signature Lines",(11,40)-(498,325),5
  1640.      GOSUB "Build_Edits"
  1641. RETURN
  1642.  
  1643.  
  1644. "Format_Window"
  1645.      CALL PENNORMAL
  1646.  
  1647.      LONG IF WINDOW(0)=1
  1648.  
  1649.           CALL PENNORMAL
  1650.           t%=15:l%=65:b%=298:r%=489:PEN 1,1,,,0
  1651.           CALL FRAMERECT(t%)
  1652.           t%=19:l%=69:b%=294:r%=485:PEN 2,2,,,0
  1653.           CALL FRAMERECT(t%)
  1654.           t%=145:l%=15:b%=304:r%=141:PEN ,,,,19
  1655.           CALL PAINTRECT(t%)
  1656.           t%=145:l%=15:b%=304:r%=141:PEN 1,1,,,0
  1657.           CALL FRAMERECT(t%)
  1658.           t%=148:l%=18:b%=301:r%=138:PEN 2,2,,,0
  1659.           CALL FRAMERECT(t%)
  1660.           PICTURE (18,148),Pict&
  1661.  
  1662.           t%=260:l%=412:b%=280:r%=471:GOSUB"Frame_Button"
  1663.           TEXT 0,12,0,0:t%=31:l%=81:b%=47:r%=151:Temp$="BBS Name:"
  1664.           CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),t%,-1)
  1665.           t%=55:l%=77:b%=71:Temp$="BBS Folder:"
  1666.           CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),t%,-1)
  1667.           t%=81:l%=74:b%=97:Temp$="Report Log:"
  1668.           CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),t%,-1)
  1669.           t%=106:l%=73:b%=122:r%=152:Temp$="Last Msg #:"
  1670.           CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),t%,-1)
  1671.           l%=299:r%=390:Temp$="NetMail Area:"
  1672.           CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),t%,-1)
  1673.  
  1674.           TEXT 0,12,
  1675.           t%=28:l%=155:b%=50:r%=440:PEN 1,1,1,8,0
  1676.           CALL FRAMERECT(t%)
  1677.           t%=53:b%=75
  1678.           CALL FRAMERECT(t%)
  1679.           t%=78:b%=100
  1680.           CALL FRAMERECT(t%)
  1681.           t%=103:l%=394:b%=125
  1682.           CALL FRAMERECT(t%)
  1683.           l%=155:r%=254
  1684.           CALL FRAMERECT(t%)
  1685.  
  1686.           PEN 2,2,,,3
  1687.           PLOT 448,48 TO 466,48
  1688.           PLOT 471,31 TO 471,45
  1689.           PLOT 467,48 TO 471,45
  1690.  
  1691.           PLOT 448,74 TO 466,74
  1692.           PLOT 471,59 TO 471,71
  1693.           PLOT 467,74 TO 471,71
  1694.  
  1695.           PLOT 449,99 TO 466,99
  1696.           PLOT 471,83 TO 471,95
  1697.           PLOT 467,99 TO 471,95
  1698.  
  1699.           PLOT 262,124 TO 280,124
  1700.           PLOT 284,108 TO 284,120
  1701.           PLOT 280,124 TO 284,120
  1702.  
  1703.           PLOT 315,171 TO 466,171
  1704.           PLOT 471,155 TO 471,167
  1705.           PLOT 467,171 TO 471,167
  1706.  
  1707.           PLOT 413,247 TO 466,247
  1708.           PLOT 471,231 TO 471,244
  1709.           PLOT 467,247 TO 471,243
  1710.  
  1711.           PLOT 368,210 TO 466,210
  1712.           PLOT 471,195 TO 471,207
  1713.           PLOT 467,210 TO 471,207
  1714.  
  1715.      END IF
  1716.  
  1717.      LONG IF WINDOW(0)=2
  1718.           t%=26:l%=5:b%=48:r%=481:PEN 1,1,1,8
  1719.           CALL FRAMERECT(t%)
  1720.           t%=50:b%=72
  1721.           CALL FRAMERECT(t%)
  1722.           t%=74:b%=96
  1723.           CALL FRAMERECT(t%)
  1724.           t%=98:b%=120
  1725.           CALL FRAMERECT(t%)
  1726.           t%=122:b%=144
  1727.           CALL FRAMERECT(t%)
  1728.           t%=2:b%=24
  1729.           CALL FRAMERECT(t%)
  1730.           t%=146:b%=168
  1731.           CALL FRAMERECT(t%)
  1732.           t%=170:b%=192
  1733.           CALL FRAMERECT(t%)
  1734.           t%=194:b%=216
  1735.           CALL FRAMERECT(t%)
  1736.           t%=218:b%=240
  1737.           CALL FRAMERECT(t%)
  1738.           t%=253:l%=392:b%=273:r%=453:GOSUB"Frame_Button"
  1739.           TEXT 0,12,0,0:t%=256:l%=29:b%=272:r%=285:Temp$="Signature lines for append to Echomail"
  1740.           CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),t%, 0)
  1741.      END IF
  1742.      CALL PENNORMAL
  1743.      RETURN
  1744.  
  1745.  
  1746. "Build_Edits"
  1747.      TEXT ,,0,0
  1748.  
  1749.      LONG IF WINDOW(0)=1
  1750.  
  1751.           t%=0:l%=0:b%=343:r%=520:PEN ,,,,3
  1752.           CALL PAINTRECT(t%)
  1753.           t%=15:l%=65:b%=298:r%=489:PEN ,,,,19
  1754.           CALL PAINTRECT(t%)
  1755.  
  1756.           BUTTON 1 ,b%(1),"Process all Msgs",(155,135)-(284,150),2
  1757.           BUTTON 2 ,b%(2),"Delete NetMail",(155,154)-(272,169),2
  1758.           BUTTON 3 ,b%(3),"Notify Sysop",(155,173)-(258,188),2
  1759.           BUTTON 4 ,b%(4),"Append Origin/NetMail",(155,192)-(323,207),2
  1760.           BUTTON 5 ,b%(5),"Append Signature/EchoMail",(155,211)-(355,226),2
  1761.           BUTTON 6 ,b%(6),"Activate Log",(155,230)-(257,245),2
  1762.           BUTTON 7 ,b%(7),"Use Full Stats",(172,249)-(280,264),2
  1763.           BUTTON 8 ,b%(8),"Erase Log",(172,268)-(255,283),2
  1764.           BUTTON 17 ,SkipExport%,"Generic Echoes",(270,268)-(390,283),2
  1765.  
  1766.           EDIT FIELD 1,RRHost$,(157,31)-(438,46),3,1
  1767.           EDIT FIELD 2,BBSFolder$,(157,56)-(438,71),3,1
  1768.           EDIT FIELD 3,ReportLog$,(157,81)-(438,96),3,1
  1769.           EDIT FIELD 4,OldHighMessage$,(157,106)-(252,121),3,1
  1770.           EDIT FIELD 5,NetMailArea$,(396,106)-(438,121),3,1
  1771.  
  1772.           BUTTON 9 ,1,"√",(444,28)-(471,48),1
  1773.           BUTTON 10 ,1,"√",(445,54)-(471,74),1
  1774.           BUTTON 11 ,1,"√",(446,79)-(471,99),1
  1775.           BUTTON 12 ,1,"√",(259,104)-(284,124),1
  1776.           BUTTON 16 ,1,"Help/About",(365,190)-(471,210),1
  1777.  
  1778.           BUTTON 13 ,1," Save ",(412,260)-(471,280),1
  1779.           BUTTON 14 ,1,"Configure Signature",(311,151)-(471,171),1
  1780.           BUTTON 15 ,1,"Cancel",(408,227)-(471,247),1
  1781.           EDIT FIELD 1
  1782.           Field%=1
  1783.      END IF
  1784.  
  1785.      LONG IF WINDOW(0)=2
  1786.           TEXT 0,12,
  1787.           EDIT FIELD 1,Sign$(1),(8,5)-(479,20),3,1
  1788.           EDIT FIELD 2,Sign$(2),(7,29)-(478,44),3,1
  1789.           EDIT FIELD 3,Sign$(3),(7,53)-(478,68),3,1
  1790.           EDIT FIELD 4,Sign$(4),(7,77)-(478,92),3,1
  1791.           EDIT FIELD 5,Sign$(5),(7,101)-(478,116),3,1
  1792.           EDIT FIELD 6,Sign$(6),(7,125)-(478,140),3,1
  1793.           EDIT FIELD 7,Sign$(7),(7,149)-(478,164),3,1
  1794.           EDIT FIELD 8,Sign$(8),(7,173)-(478,188),3,1
  1795.           EDIT FIELD 9,Sign$(9),(7,197)-(478,212),3,1
  1796.           EDIT FIELD 10,Sign$(10),(7,221)-(478,236),3,1
  1797.           BUTTON 1 ,1,"Cancel",(318,254)-(381,274),1
  1798.           BUTTON 2 ,1,"   OK   ",(392,253)-(453,273),1
  1799.           EDIT FIELD 1
  1800.           Field%=1
  1801.      END IF
  1802.  
  1803.      RETURN
  1804.  
  1805.  
  1806. "Resource_Update"
  1807.  
  1808.      a$=EDIT$(2)
  1809.      Check$=RIGHT$(a$,1)
  1810.      LONG IF Check$ <> ":"
  1811.           BBSFolder$=a$+":"
  1812.           BEEP
  1813.           Button%=0
  1814.           EDIT FIELD #2,BBSFolder$
  1815.           CURSOR 0
  1816.           GOTO "Loop"
  1817.      END IF
  1818.  
  1819.      RCount%=0
  1820.      FOR ResourceCount%=1230 TO 1234
  1821.                
  1822.           GOSUB "Cursor_Spin"
  1823.           RCount%=RCount%+1
  1824.           default$ = EDIT$(RCount%)
  1825.           StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  1826.           CALL SETSTRING(StrHnd&,default$)
  1827.           CALL CHANGEDRESOURCE(StrHnd&)
  1828.           CALL UPDATERESFILE(Refnum%)
  1829.  
  1830.      NEXT ResourceCount%
  1831.  
  1832.      FOR ResourceCount%=1235 TO 1242
  1833.  
  1834.           GOSUB "Cursor_Spin"
  1835.           default$ = STR$(b%(ResourceCount%-1234))
  1836.           StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  1837.           CALL SETSTRING(StrHnd&,default$)
  1838.           CALL CHANGEDRESOURCE(StrHnd&)
  1839.           CALL UPDATERESFILE(Refnum%)
  1840.  
  1841.       NEXT ResourceCount%
  1842.  
  1843.       FOR ResourceCount%=1243 TO 1252
  1844.  
  1845.           GOSUB "Cursor_Spin"
  1846.           default$ = Sign$(ResourceCount%-1242)
  1847.           StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  1848.           CALL SETSTRING(StrHnd&,default$)
  1849.           CALL CHANGEDRESOURCE(StrHnd&)
  1850.           CALL UPDATERESFILE(Refnum%)
  1851.  
  1852.      NEXT ResourceCount%
  1853.  
  1854.      GOSUB "Cursor_Spin"
  1855.      default$ = STR$(SkipExport%)
  1856.      StrHnd&=FN GETRESOURCE(CVI("STR "),1258)
  1857.      CALL SETSTRING(StrHnd&,default$)
  1858.      CALL CHANGEDRESOURCE(StrHnd&)
  1859.      CALL UPDATERESFILE(Refnum%)
  1860.  
  1861.      SEGMENT RETURN
  1862.  
  1863.  
  1864.  
  1865.  
  1866. Shareware price for mantissa is $30.00.  
  1867.  
  1868.      The following is a list of features in Mantissa 3.2.
  1869.  
  1870.      Mantissa is a message base management utility, that helps SS/Tabby
  1871.      sysops maintain the high volume of echo and local mail that enter
  1872.      and leave their system.
  1873.  
  1874.      o Each message section can have a unique:
  1875.           o Day limit (0-999)
  1876.           o Section Limit (0-999)
  1877.           o Archive Limit (0-999k)*
  1878.           o Archive Location (any valid path)*
  1879.      o Archives can have unique or the same archive paths*
  1880.      o nonSection messages are automatically deleted*
  1881.      o Global Limit Set Option*
  1882.      o Global Day Limit Set Option*
  1883.      o Global Archive Limit Set Option*
  1884.      o Global Archive Location Set Option*
  1885.      o Control 'set' Buttons for Setting unique Pathnames*
  1886.      o Multiple ways to move from section to section*
  1887.           o List Manager Scroll Feature*
  1888.           o Popup Menus*
  1889.           o Control Button Forward/Reverse*
  1890.           o Menu Commands*
  1891.           o Command Keys*
  1892.      o On Line Help*
  1893.      o Full Support of Mac Interface
  1894.      o Delete by Age Only
  1895.      o Delete by Limit Only
  1896.      o Delete by both Age/Limit
  1897.      o Master Archive On/Off switch*
  1898.      o Individual Delete/Limit ON/OFF Markers*
  1899.      o Renumber Messages*
  1900.           o Renumber Forward from message #1*
  1901.           o Renumber Reverse from high Message No.*
  1902.           o Renumber Userlog, High message last read*
  1903.           o Renumber on Specified Dates Only*
  1904.      o Use STR's or Text file to save settings.*
  1905.      o Network and Remote Maintenance supported
  1906.      o Turn Mantissa Log On/Off
  1907.      o Select Location and Name of Mantissa Log
  1908.      o Epistle Generator
  1909.           o On/Off Epistle Generator
  1910.           o Max. Message Level Show Clearance
  1911.           o Select location/name of Epistle Report
  1912.           o Append/Erase Epistle Report
  1913.      o Keep .Bak's or discard them*
  1914.      o Security marker for High Clearance sections*
  1915.      o Major speed boost over 1.0
  1916.      o Tabby Compatible or Standalone        * - New in 3.x version
  1917.  
  1918.  
  1919. In addition to Mantissa 3.2 Registered users are provided with the 
  1920. updated Export 3.2.  Export is a utility that is essential if you run 
  1921. SS and Tabby.  Export 3.2 has been greatly expanded and turbo charged.
  1922. Sysop are are given extraordinary control over data exported from their 
  1923. system.  Export 3.2, Probe 3.2, PreStamp 3.2 and Sundial 3.2 are only 
  1924. being made available to Registered Mantissa users.
  1925.  
  1926. Options Available in Export 3.2:
  1927.  
  1928.      o Point Message Support*     
  1929.      o Process all/new Messages*
  1930.      o Delete NetMail as Processed
  1931.      o Notify Sysop of Export*
  1932.      o Summary of Last 5 Exports*
  1933.      o Append Origin to Netmail
  1934.      o D'Bridge Areafix support
  1935.      o Turn Log on/off
  1936.      o Select location/name of log
  1937.      o Append directly to Tabby Log
  1938.      o Full support of mac interface
  1939.      o Use Short/Long Reports
  1940.      o Node Alias for Netmail*
  1941.      o Use Generic Echoes/Seenby.bbs files*
  1942.      o Compatible with Origin Master (by Lance Rasmussen)
  1943.      o On Line Help*
  1944.      o Major speed boost over 2.52
  1945.      o Erase/Append to Log*       * - New in 3.x version
  1946.  
  1947.  
  1948. Utilities from, Lininger Technology:
  1949.  
  1950.                    Free to all         Registered Mantissa
  1951. Versions
  1952.  
  1953. Export                2.54                  3.2
  1954. Import                2.53                  2.53 (update soon)
  1955. Sundial               2.1                   3.2
  1956. PreStamp              2.0                   3.2
  1957. Mantissa              1.0 (demo)            3.2
  1958. Probe                  .53                  3.2
  1959. R.Prestamp            2.0                   2.0  (update soon)
  1960. Sapphire              2.1t                  2.1t (update soon)
  1961. Epistle II            1.0                   1.0   
  1962. TPort                 1.0                   1.0
  1963. *Pleiades (1)         -NA-                   .25 (Phase 1 only)
  1964.  
  1965.  
  1966. Special thanks to,
  1967.     Tom Fitzsimmons, Mark Bryant, Lance Rasmussen & Ralph Merritt
  1968. for their great ideas and for risking life and data while beta testing
  1969. the above products.
  1970.  
  1971.  
  1972. Mantissa($30.00):
  1973. Lininger Technology
  1974. Suite 'A'
  1975. 385 Bowling Green Place
  1976. Gahanna, Ohio  43230
  1977. 614-471-6209  226/200
  1978.  
  1979.  
  1980.  
  1981. Applications Freq. from 1:226/200 or 1:350/90
  1982.  
  1983. For General Release:
  1984.  
  1985. Epistle1.sit - Epistle II 1.0
  1986. Export25.sit - Export 2.54
  1987. Import25.sit - Import 2.53
  1988. Mant10.sit   - Mantissa 1.0
  1989. PreStp20.sit - Prestamp 2.0
  1990. Probe.53.sit - Probe .53
  1991. RPreSt20.sit - R.Prestamp (Robot)
  1992. Sapph21t.sit - Sapphire 2.1t
  1993. Sundil21.sit - Sundial 2.1
  1994. TPort10.sit  - TabbyPort 1.0
  1995. TurboT.sit   - TurboPascal launch.next source (original by Pete Johnson)
  1996. ZLaunch.sit  - ZBasic launch.next source code
  1997.  
  1998.                No password required to get the above files
  1999.  
  2000.  
  2001.  
  2002. For Restistered Mantissa Users:
  2003.  
  2004. Export32.sit <password> - Export 3.21
  2005. Mant32.sit   <password> - Mantissa 3.2
  2006. PreStp32.sit <password> - PreStamp 3.2
  2007. Probe32.sit  <password> - Proble 3.2
  2008. Sundil32.sit <Password> - Sundial 3.2
  2009.  
  2010.              <Password> is the first 4 uppercase characters of the filename
  2011.                         mentioned in your Mantissa registration cover letter 
  2012.                         that accompanied your master disk.
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.